import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';
import 'package:getwidget/getwidget.dart';
import 'package:meal/constant/sizes.dart';
import 'package:meal/utils/colors.dart';
import 'package:meal/utils/styles.dart';
import 'package:meal/utils/tools.dart';

///
/// 编辑默认回复
///
class EditReply extends StatefulWidget {
  const EditReply({Key? key}) : super(key: key);

  @override
  State<EditReply> createState() => _EditReplyState();
}

class _EditReplyState extends State<EditReply> {
  String content = '';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: ToolsUtils.getDefaultBackgroundColor(),
      appBar: ToolsUtils.getDefaultBrnAppBar('默认回复'),
      body: SingleChildScrollView(
        child: Column(
          children: [
            Container(
              margin: const EdgeInsets.only(top: Sizes.default20),
              padding: const EdgeInsets.all(Sizes.default10),
              decoration: const BoxDecoration(color: Colors.white),
              child: BrnInputText(
                minHeight: 200,
                minLines: 4,
                maxLength: 200,
                bgColor: ColorsUtils.rgba(247, 247, 247, 1),
                padding: const EdgeInsets.all(Sizes.default10),
                borderRadius: Sizes.default10,
                hint: '请输入默认回复内容~',
                onTextChange: (String text) {
                  setState(() {
                    content = text;
                  });
                },
              ),
            ),
            Container(
              margin: const EdgeInsets.only(top: Sizes.default20),
              height: Sizes.default50,
              child: FractionallySizedBox(
                widthFactor: 0.8,
                heightFactor: 0.9,
                child: GFButton(
                    onPressed: () {},
                    text: '保存',
                    textStyle: StylesUtils.customTextStyle(fontSize: Sizes.default16),
                    shape: GFButtonShape.pills,
                    type: GFButtonType.solid,
                    size: GFSize.LARGE,
                    color: ColorsUtils.parseColorFromHexString(ColorsUtils.colorFf6)),
              ),
            )
          ],
        ),
      ),
    );
  }
}
